/*
由 Aqua Data Studio 7.5.11 于 九月-13-2011 11:24:15 下午
 日生成的脚本数据库：dailyapp
架构：<所有架构>
对象：TABLE
*/
DROP TABLE "da_video"
GO
DROP TABLE "da_picture"
GO
DROP TABLE "da_down"
GO
DROP TABLE "da_category"
GO
DROP TABLE "da_app"
GO
DROP TABLE "da_age"
GO

CREATE TABLE "da_age" ( 
	"app_id"	bigint(20) NOT NULL,
	"baby"  	tinyint(1) COMMENT '婴儿'  NULL DEFAULT '0',
	"child" 	tinyint(1) COMMENT '儿童'  NULL DEFAULT '0',
	"young" 	tinyint(1) COMMENT '青年'  NULL DEFAULT '0',
	"adult" 	tinyint(1) COMMENT '成年'  NULL DEFAULT '0',
	"old"   	tinyint(1) COMMENT '老年'  NULL DEFAULT '0',
	PRIMARY KEY("app_id")
)
COMMENT = '程序适用年龄阶段' 
GO
CREATE TABLE "da_app" ( 
	"id"         	bigint(20) AUTO_INCREMENT COMMENT '自增ID'  NOT NULL,
	"name"       	varchar(50) COMMENT '名字'  NOT NULL,
	"icon"       	varchar(400) COMMENT '图标地址'  NULL,
	"description"	text COMMENT '描述'  NULL,
	"daily"      	varchar(10) COMMENT '日期：格式： 20110101'  NULL,
	"sex"        	int(11) COMMENT '0-所有，1-偏向女性，2-偏向男性'  NULL DEFAULT '0',
	"category_id"	bigint(20) COMMENT '类别'  NULL,
	"recommend"  	int(11) COMMENT '推荐指数最少0，最大10'  NULL,
	"down_time"  	int(11) COMMENT '下载次数'  NULL,
	PRIMARY KEY("id")
)
COMMENT = '程序基本信息' 
GO
CREATE TABLE "da_category" ( 
	"id"  	bigint(20) AUTO_INCREMENT NOT NULL,
	"name"	varchar(40) NULL,
	PRIMARY KEY("id")
)
COMMENT = '程序类别' 
GO
CREATE TABLE "da_down" ( 
	"id"       	bigint(20) AUTO_INCREMENT NOT NULL,
	"app_id"   	bigint(20) NOT NULL,
	"market"   	varchar(50) COMMENT '市场名字如：google/hiapk/gfan/等'  NULL,
	"link"     	text COMMENT '下载地址'  NULL,
	"down_time"	int(11) NULL,
	PRIMARY KEY("id")
)
COMMENT = '程序下载地址' 
GO
CREATE TABLE "da_picture" ( 
	"id"     	bigint(20) AUTO_INCREMENT COMMENT '主键'  NOT NULL,
	"app_id" 	bigint(20) COMMENT '程序ID'  NOT NULL,
	"address"	varchar(400) COMMENT '图片地址'  NULL,
	"seq"    	int(11) COMMENT '顺序'  NULL,
	PRIMARY KEY("id")
)
COMMENT = '程序预览图片' 
GO
CREATE TABLE "da_video" ( 
	"id"     	bigint(20) AUTO_INCREMENT COMMENT '主键'  NOT NULL,
	"app_id" 	bigint(20) COMMENT '程序ID'  NOT NULL,
	"type"   	varchar(40) COMMENT '视频类型：
file: mp4等文件，程序调用播放器直接播放
web:网页，打开网页播放
youku:优酷嵌入代码播放
tudou:土豆嵌入代码播放'  NULL,
	"pre_img"	varchar(400) COMMENT '预览图片'  NULL,
	"address"	varchar(400) COMMENT '图片地址'  NULL,
	PRIMARY KEY("id")
)
COMMENT = '程序演示视频' 
GO

